Skip to content

feat(hellgraph): HellGraph as a first-class always-on OS primitive (systemd) - #326

Merged
mdheller merged 3 commits into
mainfrom
feat/hellgraph-service
Aug 4, 2026
Merged

feat(hellgraph): HellGraph as a first-class always-on OS primitive (systemd)#326
mdheller merged 3 commits into
mainfrom
feat/hellgraph-service

Conversation

@mdheller

@mdheller mdheller commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

Makes HellGraph an always-on systemd service on SourceOS — the model you described (always-on local graph, p2p opt-in), mirroring sourceos-syncd (the one primitive that was actually wired, per the earlier audit). Closes a real piece of the 'first-class OS primitives' gap.

Why it's real, not another inert scaffold

HellGraph ships a committed, self-contained ts/distpackage.json has zero runtime deps and the dist imports only node: builtins + relative paths. So packages/hellgraph/default.nix is a genuine node wrapper (no npm build, no node_modules), and the daemon runs on node alone (proven: the bins run standalone). Contrast sourceos-shell, whose package never built.

  • packages/hellgraph/default.nix — wraps hellgraph-superpeer + hellgraph-agent-ingest (both on main).
  • modules/nixos/hellgraph/default.nixoptions.sourceos.hellgraph; systemd.services.hellgraph runs the superpeer (serves the graph over HTTP). Local-only by default; p2p federation is opt-in via HELLGRAPH_BOOTSTRAP_KEY (supplied by LoadCredential, never inline). Hardened (DynamicUser, ProtectSystem=strict, StateDirectory).
  • flake.nixhellgraph-src input + package + nixosModules.hellgraph.
  • Enabled on canary-x86_64.

Verification (honest)

All .nix parse-verified (nix-instantiate --parse); runtime proven self-contained. A full nix build / image build needs a Linux/kvm nix builder (can't run on macOS). The receipt-pump ingestion unit (governance receipts → graph) layers on once hellgraph#55 merges.

…ystemd, canary host)

Mirrors sourceos-syncd — the one primitive that was actually wired. HellGraph ships a committed, self-contained ts/dist (package.json has ZERO runtime deps; dist imports only node: builtins + relative), so packages/hellgraph is a real node wrapper (no npm build, no node_modules), NOT an inert scaffold. modules/nixos/hellgraph runs hellgraph-superpeer (serves the graph over HTTP) as systemd.services.hellgraph — local-only by default, p2p federation OPT-IN via HELLGRAPH_BOOTSTRAP_KEY (LoadCredential). Wired into flake (input+package+nixosModule) and ENABLED on canary-x86_64. All .nix parse-verified; runtime proven self-contained. Full image build needs a Linux/kvm nix builder. The receipt-pump ingestion unit follows once hellgraph#55 merges.
…/nixos/hellgraph

Satisfies the adr-swap-gate (ADR-0001-nix-to-guix, Firewall #1): every newly
added .nix file must have a Guix equivalent or a governed waiver. This adds both:

guix/packages/hellgraph.scm:
  copy-build-system derivation; installs bin/+ts/ preserving the relative layout
  the entrypoints expect (bin/*.mjs → ../ts/dist/index.mjs); wraps
  hellgraph-superpeer + hellgraph-agent-ingest with the node binary.

guix/services/hellgraph.scm:
  hellgraph-service-type (shepherd); mirrors all three NixOS module options —
  superpeer? (default #f = local-only sovereign mode), bootstrap-key-file
  (read at start, never in env), extra-environment. Sovereign-first: the graph
  service is local-only by default; p2p superpeer is an explicit opt-in.

guix/NIX_BASELINE.md:
  Marks hellgraph package (◐) and hellgraph service (◐) in the parity table.
  Status = ◐ (spiked): Scheme authored, parity proven when a Linux runner
  builds the Guix package and the shepherd service activates correctly.
Both new .nix files (packages/hellgraph/default.nix and
modules/nixos/hellgraph/default.nix) have Guix equivalents authored in
this same PR — guix/packages/hellgraph.scm and guix/services/hellgraph.scm.
ADR-0001 waivers reference the equivalents; parity table already updated
in guix/NIX_BASELINE.md. Satisfies Firewall #1 (adr-swap-gate).
@mdheller
mdheller merged commit cc477ac into main Aug 4, 2026
8 checks passed
@mdheller
mdheller deleted the feat/hellgraph-service branch August 4, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant